package sc
package test

import scala.io.Source

object test4 {
  def main(args: Array[String]): Unit = {
    val bufferedSource = Source.fromFile("scala/data/students.csv")
    val list = bufferedSource.getLines().toList
    val res = list.map(e => {
      val sp = e.split(",")
      (sp(0), sp(4))
    }).groupBy {
      case (_, clazz) => clazz
    }.map {
      case (clazz, list) => (clazz, list.size)
    }.toList
    println(res)
  }

}
